package com.myframework.smhj.hibernate.dao;

import com.myframework.smhj.hibernate.Entity;
import com.myframework.smhj.spring.aop.support.AopUtils;



public abstract class TargetDao<T extends Entity> {
	/**
	 * 取得代理对象的目标对象
	 * @param proxy
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public T getEntity(T proxy){
		try {
			return (T)AopUtils.getTarget(proxy);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
